﻿<UserControl x:Class="WebCam.SelectCaptureDevice"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d">
    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="Auto">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="64"/>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="100"/>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Column="0" Text="Select Device: " FontSize="9" FontFamily="Arial" HorizontalAlignment="Left" VerticalAlignment="Center"/>
        <ComboBox Grid.Column="1" Width="Auto"
                  HorizontalAlignment="Stretch" FontSize="9" x:Name="cboEntries" 
                  ItemsSource="{Binding}" SelectionChanged="cboEntries_SelectionChanged">
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Path=DeviceName}" />
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>
        <StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Left" Width="Auto">
            <Button FontFamily="Arial" FontSize="9" Content="Use" VerticalAlignment="Center" x:Name="btnUse" Click="btnUse_Click" />
        </StackPanel>
    </Grid>
</UserControl>
